<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ShortCutRecord extends Model
{
    const UPDATED_AT = null;
    const CREATED_AT = null;
    use HasFactory;
    protected $guarded = [];
    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y/m/d H:i:s');
    }

    //子账号数

//    public function getAccount(){
//        return ShortCutRecord::query()
//            ->where('shop_manage_id',$this->attributes['shop_manage_id'])
//            ->where('is_read',1)
//            ->count();
//    }
//    protected $casts = [
//        'operator_time' => 'date:Y-m-d',
////        'joined_at' => 'datetime:Y-m-d H:00',
//    ];
    public function user()
    {
        return $this->hasOne(SystemUser::class,'id','user_id');
    }
}
